package com.fzg.controller;

import com.fzg.common.enums.ResponseWrapper;
import com.fzg.common.model.param.alioss.DeleteBlogImageOssParam;
import com.fzg.common.model.param.alioss.DeleteImageOssParam;
import com.fzg.service.AliossService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fzg
 * @since 2022-07-01
 */
@RestController
@RequestMapping("/alioss")
public class AliossController {

    @Autowired
    private AliossService aliossService;


    /**
     * @name 方法名：getAliossParams
     * @description todo: 获取阿里云连接参数
     *
     * @return  ResponseWrapper
     * @date 2022/12/26 11:49
     * @author fzg
     **/
    @GetMapping("/getAliossParams")
    public ResponseWrapper getAliossParams(){
        return aliossService.getAliossParams();
    }


    /**
     * @name 方法名：deleteImgByOss
     * @description todo: 删除图片oss(diary)
     *
     * @param param 参数类：DeleteImageOssParam
     * @return ResponseWrapper
     * @date 2022/12/26 11:50
     * @author fzg
     **/
    @PostMapping("/deleteImgByOss")
    public ResponseWrapper deleteImgByOss(@RequestBody DeleteImageOssParam param){
        return aliossService.deleteImgByOss(param);
    }


    /**
     * @name 方法名：deleteBlogImgByOss
     * @description todo: 删除图片oss(blog)
     *
     * @param param 参数类： DeleteBlogImageOssParam
     * @return ResponseWrapper
     * @date 2022/12/26 11:52
     * @author fzg
     **/
    @PostMapping("/deleteBlogImgByOss")
    public ResponseWrapper deleteBlogImgByOss(@RequestBody DeleteBlogImageOssParam param){
        return aliossService.deleteBlogImgByOss(param);
    }

}
